import java.util.ArrayList;

/*
 * Bob Dayton
 * COSC - 716 Assignment 2
 * The CompleteMenuIterator loops over all items in the array.
 */
public class CompleteMenuIterator implements MenuIterator{
	//private MenuItem[] items;
	private ArrayList<MenuItem> items = new ArrayList<MenuItem>();
	private int count;
	private int current;
	public CompleteMenuIterator(ArrayList<MenuItem> i)
	{
		items = i;
		count = 0;
	}
	
	@Override
	public MenuItem next() 
	{
		setNext();
		return items.get(current);
		
	}
	@Override
	public boolean hasNext() {
		
		if(count >= items.size())
		{
			return false;
			
		}
		else
		{
			return true;
		}
	}
	
	private void setNext()
	{
		current = count;
		count++;
	}

}
